package com.church.action;

import java.util.Locale;
import java.util.ResourceBundle;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class ChooseLocales extends ActionSupport {
	private String lanague;
	private String response;
	private Locale locale;
	
	public Locale getLocale() {
		return locale;
	}

	public void setLocale(Locale locale) {
		this.locale = locale;
	}

	public String getLanague() {
		return lanague;
	}

	public void setLanague(String lanague) {
		this.lanague = lanague;
	}

	public String getResponse() {
		return response;
	}

	public void setResponse(String response) {
		this.response = response;
	}

	public String execute() {
		
		response = "success";
		if (lanague.equals("en")) {
			locale=Locale.US;
		} else {
			locale=Locale.CHINESE;
		}
		ActionContext.getContext().getSession()
				.put("WW_TRANS_I18N_LOCALE", locale);
		return "success";
	}

}
